﻿using System;
using System.Collections.Generic;
using System.Text;

namespace T3K.SketchEditor.Core {
    public class Utils {
        private Utils() { }


        public static bool Check(char c, char[] array) {
            if (array != null) 
                for (int i = 0; i < array.Length; i++)
                    if (c.Equals(array[i])) return true;

            return false;
        }

        public static bool CheckNotNull(object obj) {
            return CheckNotNull(obj, null, false);
        }

        public static bool CheckNotNull(object obj, string name, bool throwException) {
            if (throwException && obj == null)
                if (name == null)
                    throw new ArgumentNullException();
                else
                    throw new ArgumentNullException(name);
            else
                return obj != null;
        }


    }
}
